package com.fzkj.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @DESCRIPTION: TODO 匹配host
 * @AUTHOR: AnotherOne
 * @DATE: 2021/9/30 17:26
 */
public class RegexHost {

    public static void main(String[] args) {
        int a = 10;
        int b = a / 5;
        Pattern p = Pattern.compile("(?<=//|)((\\w)+\\.)+\\w+[:]*(\\d)*");
        Matcher matcher = p.matcher("http://127.0.0.1/test/fdsaj");
        String host = "lueluelue";
        if (matcher.find()){
            host = matcher.group();
        }
        System.out.println("做出修改" + b);
        System.out.println("匹配出来的 host 是 -> " + host);
        // todo lialiali
    }
}
